#include <stdio.h>
#include <stdlib.h>

typedef int TElemSet;

typedef struct BinaryTreeNode *BinaryTree;
struct BinaryTreeNode {
    TElemSet data; /* 数据元素 */
    BinaryTree left; /* 左孩子指针 */
    BinaryTree right; /* 右孩子指针 */
};

BinaryTree CreateBinaryTree(TElemSet value, BinaryTree left_tree,
                            BinaryTree right_tree) {
    BinaryTree tree;

    tree = (BinaryTree)malloc(sizeof(struct BinaryTreeNode));
    tree->data = value;
    tree->left = left_tree;
    tree->right = right_tree;
    return tree;
}

int Max(int x, int y) {
    return (x > y) ? x : y;
}

/* 算法5-5：计算二叉树高度 Height(tree) */
int Height(BinaryTree tree) {
    int h_left, h_right;

    if (tree == NULL) { /* 空树 */
        return 0;
    } else {
        h_left = Height(tree->left); /* 遍历左子树，求子树的高度 */
        h_right = Height(tree->right); /* 遍历右子树，求子树的高度 */
        return Max(h_left, h_right) +
               1; /* 树的高度等于左右子树高度的较大值加1 */
    }
}
/* 算法5-5 结束 */

int main(void) {
    BinaryTree tree, left_tree, right_tree;
    TElemSet value;

    scanf("%d", &value);
    left_tree = CreateBinaryTree(value, NULL, NULL);
    scanf("%d", &value);
    right_tree = CreateBinaryTree(value, NULL, NULL);
    scanf("%d", &value);
    tree = CreateBinaryTree(value, left_tree, right_tree);
    printf("%d\n", Height(tree));

    return 0;
}